const http = require('http');
const querystring = require('querystring');

const server = http.createServer((req,res) => {
  if(req.method==='POST'){
    console.log('content-type',req.headers['content-type'])
    let postData='';
    req.on('data',chunk=>{
      postData+=chunk.toString()
    })

    req.on('end',() => {
      console.log(postData)
      res.end('hello world!');
    })

  } 
})

//使用postman  http://localhost:3000/user?name=wang&id=1

server.listen(3000,()=>{
  console.log('listening on 3000 port')
})



